define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'collage.collage/bindMember',
        add_url: 'collage.collage/add',
        edit_url: 'collage.collage/edit',
        delete_url: 'collage.collage/delete',
        export_url: 'collage.collage/export',
        modify_url: 'collage.collage/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: '主键id'},
                    {field: 'collage_goods_id', title: '拼团商品id'},
                    {field: 'master_id', title: '所属团长id'},
                    {field: 'user_id', title: '用户id'},
                    {field: 'status', title: '拼团状态 0-未开启 1-开启 2-完成', templet: ea.table.switch},
                    {field: 'create_time', title: '创建时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});